//
//  StockContext.h
//  Stock
//
//  Created by blacksun on 11-6-23.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "MyStock.h"
#import "Section.h"

#define kNeedUpdateRadarDateNotification    @"needUpdateRadarDateNotification"
/*
 1）radarTest == 1
 显示"火热试用...."（不变）
 
 2）radarTest == 0 && paid == 0 && radarDays >=0
 显示“您的雷达推送服务将于YYYYMMDD到期”（不变）
 
 3）paid == 1 && radarDays >= 0
 隐藏整个内容条
 
 4）radarDays < 0
 显示“您的雷达推送服务已于YYYYMMDD到期”
*/
typedef enum {
    RadarServiceStatuTrial,//火热试用
    RadarServiceStatuTrialAndFinishQuestion,//火热试用
    RadarServiceStatuWarning,//将要到期
    RadarServiceStatuExpire,//已经到期
    RadarServiceStatuNormal//正常，正在使用
}RadarServiceStatu;

@interface StockContext : NSObject {
    int workingStock;
    NSString *userId;
    NSArray *sections;
    NSMutableArray *remoteMyStocks;
    BOOL isFavorite;
    NSArray *updateTimes;
    BOOL radarTest;
    NSInteger radarDays;
    BOOL paid;
    BOOL needDisplayOpnition;
    
}

@property(nonatomic, assign) int workingStock;
@property(nonatomic, retain) NSMutableArray *remoteMyStocks;
@property(nonatomic, retain) NSArray *sections;
@property(nonatomic, retain) NSString *userId;
@property(nonatomic, assign) BOOL isFavorite;
@property(nonatomic, retain) NSArray *updateTimes;
@property(nonatomic, assign) BOOL radarTest;
@property(nonatomic, assign) NSInteger radarDays;
@property(nonatomic, assign) BOOL needDisplayOpnition;
@property(nonatomic, assign) BOOL paid;

-(int)findMaxIndexWithSectionId:(NSString *)sectionId;
+(StockContext *)shareInstance;
-(MyStock *)findRemoteStockWithStockId:(NSString *)stockId;
-(RadarServiceStatu)radarStatus;
-(void)setFinishQuestions;
-(void)updateaRadarDate:(NSString*)date;
-(void)saveChargeEmail:(NSString *)email;
-(void)saveChargePassword:(NSString *)password;
-(NSString *)savedChargeEmail;
-(NSString *)getRadaDate;
@end
